﻿namespace Nomo.UnityCoreModule.Waiters
{
    /// <summary>
    /// 真实时间等待器。
    /// </summary>
    public sealed class RealTimeWaiter : TimeWaiter
    {
        internal RealTimeWaiter(float waitTime) : base(waitTime) { }

        private protected override bool KeepWaiting
        {
            get
            {
                var returnValue = CurrentTime < WaitTime;
                CurrentTime += UnityEngine.Time.unscaledDeltaTime;
                return returnValue;
            }
        }
    }
}
